package com.a16.yuejian.yuejian.activity;

import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.a16.yuejian.yuejian.R;
import com.a16.yuejian.yuejian.javabean.Collected;
import com.a16.yuejian.yuejian.listener.CollectedListener;
import com.a16.yuejian.yuejian.model.ActivityModel;

public class AcMenuActivity extends PopupWindow {
    private View View;
    private LinearLayout menu_follow;
    private ImageView xin;
    CollectedListener collectedListener=new CollectedListener() {
        @Override
        public void onResponse(Collected collected) {
            if(collected.getCollected().equals("1")){
                xin.setImageResource(R.drawable.ic_aixin1);
            }else if(collected.getCollected().equals("0")){
                xin.setImageResource(R.drawable.ic_aixin);
            }
        }

        @Override
        public void onFail() {

        }
    };
    public  AcMenuActivity(Activity paramActivity, View.OnClickListener paramOnClickListener,
                           int width, int height,String ac_id,String uid){
        View = LayoutInflater.from(paramActivity).inflate(R.layout.activity_ac_menu, null);
        menu_follow = (LinearLayout) View.findViewById(R.id.menu_follow);
        xin = (ImageView)View.findViewById(R.id.menu_aixin);
        ActivityModel activityModel = new ActivityModel();
        activityModel.isCollected(ac_id,uid,"1",collectedListener);
        if (paramOnClickListener != null){
            menu_follow.setOnClickListener(paramOnClickListener);
            setContentView(View);
            setWidth(width);
            setHeight(height);
            setBackgroundDrawable(new ColorDrawable(0));
        }
    }
}
